/*
 * @Description: 工具类
 * @Author: cgt
 * @Date: 2021-10-20 17:40:38
 * @LastEditors: cgt
 * @LastEditTime: 2021-12-28 19:42:18
 */
/**
 * @module init/initUtils
 * @desc 初始化工具类
 */

import * as CoordinateUtil from '../utils/CoordinateUtil';
import * as Geojson2WKTUtil from '../utils/Geojson2WKTUtil';
import * as ImageUtil from '../utils/ImageUtil';
import AdvancedSnapUtil from '../utils/AdvancedSnapUtil';
import CursorUtil from '../utils/CursorUtil';
import DebugUtil from '../utils/DebugUtil';
import LoadingUtil from '../utils/LoadingUtil';
import StyleSwitchUtil from '../utils/StyleSwitchUtil';

/**
 * 初始化工具类
 * @param {Map} top 地图开放顶层
 * @param {*} impl 地图实现
 */
export function initUtils(top, impl) {
  top.utils = {
    CursorUtil: new CursorUtil(impl.map),
    DebugUtil: new DebugUtil(top),
    ImageUtil: ImageUtil,
    LoadingUtil: new LoadingUtil(),
    StyleSwitchUtil: new StyleSwitchUtil(impl.map),
    CoordinateUtil: CoordinateUtil,
    Geojson2WKTUtil: Geojson2WKTUtil,
    AdvancedSnapUtil: AdvancedSnapUtil
  };
}
